<?php
/**
 * Created by PhpStorm.
 * User: CS
 * Date: 2018/11/12
 * Time: 19:26
 */

function getjifen($con,$id){
    //查询当前积分
    $sql = "select `jifen`,`game_user` from `gm_index` where `id` = $id";
    $re = mysqli_query($con,$sql);
    $row = mysqli_fetch_assoc($re);
    return $row['jifen'];
}

function updatejifen($con,$id,$new){
    //写入新积分
    $sql = "update `gm_index` set `jifen` = $new where `id` = $id";
    $re = mysqli_query($con,$sql);
    if($re){
        return true;
    }else{
        return false;
    }
}
